Fix Docker Compose build: SSL certificate trust, WASM dependencies, and Cargo.toml configuration #2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
Fixed multiple issues preventing the Docker Compose build from completing successfully. The build was failing due to SSL certificate verification errors, missing WASM compilation dependencies, and Cargo.toml configuration issues.
Root Causes Identified
1. SSL Certificate Verification Failure
The build environment uses a GoProxy MITM proxy with a self-signed mkcert certificate for intercepting HTTPS traffic. When downloading dependencies from GitHub and crates.io, both
wgetandcurlwere failing with SSL verification errors:2. WASM Compilation Errors
The
onig_syscrate (used as a transitive dependency) failed to compile for thewasm32-unknown-unknowntarget because clang couldn't find standard C library headers:3. Cargo.toml Configuration
The project defines multiple binary targets (
chatclmandtuning), but cargo-leptos wasn't told which one to use:Changes Made
Dockerfile
build-essential,clang, andwasi-libcpackagesCFLAGS_wasm32_unknown_unknownenvironment variable to point clang to the correct system headers for WASM compilationCargo.toml
bin-target = "chatclm"to the[package.metadata.leptos]section to explicitly tell cargo-leptos which binary to build.gitignore
Testing Notes
The mkcert certificate file is environment-specific and is not committed to the repository. Developers building in different environments may need to:
Related
Fixes the issue described in #[issue_number] - "Docker compose build should work again"
Original prompt
Fixes #1
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.